package com.atguigu.yygh.user.util;

import com.atguigu.yygh.common.util.JwtHelper;

import javax.servlet.http.HttpServletRequest;

/**
 * @program: yygh_parent
 * @author: Mr.Zhuo
 * @create: 2022-03-16 09:00
 **/
public class TokenUtils {

    public static Long getUserId(HttpServletRequest request) {
        String token = request.getHeader("token");

        return JwtHelper.getUserId(token);
    }

    public static String getUserName(HttpServletRequest request) {
        String token = request.getHeader("token");
        return JwtHelper.getUserName(token);
    }

}
